<template>
  <view>
    <u-tabs :list="list" active-color="#ffb849" :is-scroll="false" :current="current" @change="change"></u-tabs>

    <view class="filters">
      <view class="filter">全部</view>
      <view class="filter">运动</view>
      <view class="filter on">饮食</view>
    </view>

    <view class="u-p-24" v-show="current == 0">
      <view class="follow-good gap-24" v-for="i in 5" :key="i" @click="$goto('/pages/shop/good')">
        <image class="pic" src="https://picsum.photos/id/454/300/300" mode=""></image>
        <view class="info">
          <view class="title u-line-2">四轮滑板轮子双翘板刷街轮子软轮公路轮代步减震滑板闪光减震滑板闪光轮</view>
          <view class="sub u-line-1">123456收藏</view>

          <u-gap height="64"></u-gap>
          <view class="flex-row justify-between align-center" style="width: 100%;">
            <view class="price">￥234</view>
            <my-btn :size="[100, 50, 24]" border="1px solid #000" inline round>删除</my-btn>
          </view>
        </view>
      </view>
    </view>

    <view class="u-p-24" v-show="current == 1">
      <view class="gap-24" v-for="i in 5" :key="i" @click="$goto('/pages/shop/index')">
        <shop></shop>
      </view>
    </view>

    <view class="u-p-80 empty">
      <my-btn :size="[230, 90, 30]" color="#fff" bg="#ffb849" round>去逛逛</my-btn>
    </view>
  </view>
</template>

<script>
  import shop from '../home/components/shop.vue'
  export default {
    components: {
      shop
    },
    data() {
      return {
        list: [{
          name: '商品'
        }, {
          name: '店铺'
        }],
        current: 0
      };
    },
    methods: {
      change(e) {
        this.current = e
      }
    }
  }
</script>

<style lang="scss">
  .filters {
    display: flex;
    align-items: center;
    padding: 24rpx 24rpx 0 24rpx;

    .filter {
      background: #fff;
      color: #999999;
      border: 1px solid #999999;
      background: transparent;
      padding: 8rpx 24rpx;
      border-radius: 40rpx;
      margin-right: 16rpx;
      margin-bottom: 16rpx;
    }

    .filter.on {
      color: #fff;
      background: #FFB849;
      border: 1px solid #FFB849;
    }
  }

  .follow-good {
    background: #fff;
    padding: 24rpx;
    border-radius: 24rpx;
    display: flex;
    justify-content: space-between;

    .pic {
      width: 240rpx;
      height: 240rpx;
      object-fit: cover;
    }

    .info {
      width: 400rpx;
      height: 240rpx;
    }

    .sub {
      color: #bcbcbc;
      font-size: 24rpx;
    }

    .price {
      color: red;
      font-size: 32rpx;
    }
  }
</style>
